public class test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();

        System.out.println(root.val);
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("节点的个数：");
        System.out.println(binaryTree.size2(root));
        System.out.println("叶子节点的个数：");
        binaryTree.getLeafNodeCount1(root);
        //System.out.println(binaryTree.leafSize);
        System.out.println(binaryTree.
                getLeafNodeCount2(root));
        System.out.println("第K层节点的个数：");
        System.out.println(binaryTree.getKLevelNodeCount(root,3));

        System.out.println("树的高度：");
        System.out.println(binaryTree.getHeight(root));

        System.out.println("查找节点：");
        BinaryTree.TreeNode ret = binaryTree.find(root, 'p');


    }

}
